package com.hsd.znsh.controller.app;

import com.hsd.znsh.config.ZnshMqttConfig;
import com.hsd.znsh.entity.*;
import com.hsd.znsh.enums.ResultEnum;
import com.hsd.znsh.exception.ZnshException;
import com.hsd.znsh.pojo.output.ResultVO;
import com.hsd.znsh.pojo.query.SensorInfoQuery;
import com.hsd.znsh.properties.MqttProperties;
import com.hsd.znsh.service.*;
import com.hsd.znsh.utils.ResultVOUtil;
import com.hsd.znsh.utils.ValidatorUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.integration.annotation.Gateway;
import org.springframework.integration.annotation.MessagingGateway;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;
import java.util.List;
import java.util.Map;

/*
 * @auther: wangjiacai
 *
 * @create: 2018-05-02 10:21:49
 */
@RestController
@RequestMapping("/app/control")
public class APPControlController {

    @Autowired
    private ControlService controlService;

    @GetMapping("/getControlListByHostSn")
    public ResultVO getControlListByHostSn(String hostSn){
        List<Control> list=controlService.getControlListByHostSn(hostSn);
        return ResultVOUtil.success(list);
    }

    @PostMapping("/updateWorkStatus")
    public ResultVO updateWorkStatus(String controlSn,Integer workStatus){
        controlService.updateWorkStatus(controlSn,workStatus);
        return ResultVOUtil.success();
    }


}
